package com.kotasoft.training.roogwteclipselink.shared.domain;

import javax.persistence.CascadeType;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity
public class Profesor {

    @NotNull
    private String nombre;

    @NotNull
    private String apellidos;

    @NotNull
    @Pattern(regexp = "^[^@ ]+@[^@ ]+.[^@ .]+$")
    private String email;

    @ManyToOne(cascade = CascadeType.ALL)
    private Departamento departamento;
}
